home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / vlapak1.zip / TESTVID.ZIP / TESTVID.ASM < prev    next >
Assembly Source File  |  1993-10-15  |  4KB  |  185 lines

  1. COMMENT $    
  2. ────────────────────────────────────────────────────────────────────────────
  3.  
  4. This program shows the speed of your VGA card in three different modes-
  5.  
  6.  1: Dumping a constant value to the VGA card (via REP STOSD)
  7.  
  8.  2: Copying a page from memory to the VGA card (via REP MOVSD) - 
  9.     this is used with virtual screens..
  10.  
  11.  3: Copying Video memory to video memory - SLOW!!
  12.  
  13.  
  14. Times I got for my 386-40 w/ Tseng4000 Hi-Color VGA card:
  15.  
  16.     1:  125 fps
  17.     2:  105 fps
  18.     3:   43 fps
  19.  
  20. Times I got for the same system, but I commented out the line that puts
  21.  the card back in Linear mode: (ie. Times in planar or modex)
  22.  To try this mode yourself, comment out the line "call ResetLinear"
  23.  
  24.     1:  113 fps
  25.     2:   97 fps
  26.     3:   36 fps
  27.  
  28. Draeden /VLA
  29. ────────────────────────────────────────────────────────────────────────────
  30. $
  31.     
  32.     Ideal
  33.     Model Small
  34.     Stack 200h
  35.     CodeSeg
  36.     Assume CS:@Code, DS:@Code
  37.     p386
  38.  
  39. ────────────────────────────────────────────────────────────────────────────
  40. INCLUDE "Modex2.Inc"
  41. INCLUDE "TimerSub.Inc"
  42. ────────────────────────────────────────────────────────────────────────────
  43. Counter dd  0
  44.  
  45. Time1   dd  0
  46. Time2   dd  0
  47. Time3   dd  0
  48.  
  49. MSG_Title   db  13,10," Frames per second for various VGA operations."
  50.             db  13,10,"$"
  51.  
  52. MSG_2VGA    db  13,10,"Writing to the screen     (2VGA): $"
  53. MSG_MEM2VGA db  13,10,"Copy Memory to the VGA (Mem2VGA): $"
  54. MSG_VGA2VGA db  13,10,"Copy VGA to VGA        (VGA2VGA): $"
  55. ────────────────────────────────────────────────────────────────────────────
  56. PROC FillVGA NEAR
  57.     mov     es,[VGAseg]
  58.     xor     di,di
  59.     mov     eax,[Counter]
  60.     xor     eax,55555555h
  61.     cld
  62.     mov     cx,256*240/4
  63.     rep     stosd
  64.  
  65.     ret
  66. ENDP
  67.  
  68. PROC CMem2VGA NEAR
  69.     mov     es,[VGAseg]
  70.     xor     di,di
  71.     xor     si,si
  72.     cld
  73.     mov     cx,256*240/4
  74.     rep     movsd
  75.  
  76.     ret
  77. ENDP
  78.  
  79. PROC CVGA2VGA NEAR
  80.     push    ds
  81.     mov     es,[VGAseg]
  82.     mov     ds,[VGAseg]
  83.     xor     di,di
  84.     mov     si,4
  85.     cld
  86.     mov     cx,256*240/4
  87.     rep     movsd
  88.     pop     ds
  89.     ret
  90. ENDP
  91. ────────────────────────────────────────────────────────────────────────────
  92. START:
  93.     mov     ax,cs
  94.     mov     ds,ax
  95.  
  96.     @SetModeX x256, y480, 2, 256
  97.     call    ResetLinear
  98.  
  99.     mov     [Counter],256
  100.     call    StartTimer
  101. MainLoop1:
  102.     call    FillVGA
  103.  
  104.     dec     [Counter]
  105.     jnz     MainLoop1
  106.     
  107.     call    StopTimer
  108.     
  109.     mov     eax,[TimerE]
  110.     sub     eax,[TimerS]
  111.     imul    eax,10
  112.     mov     [Time1],eax
  113.     
  114.     mov     [Counter],256
  115.     call    StartTimer
  116. MainLoop2:
  117.     call    Cmem2VGA
  118.  
  119.     dec     [Counter]
  120.     jnz     MainLoop2
  121.     
  122.     call    StopTimer
  123.     
  124.     mov     eax,[TimerE]
  125.     sub     eax,[TimerS]
  126.     imul    eax,10
  127.     mov     [Time2],eax
  128.  
  129.  
  130.     mov     [Counter],256
  131.     call    StartTimer
  132. MainLoop3:
  133.     call    CVGA2VGA
  134.  
  135.     dec     [Counter]
  136.     jnz     MainLoop3
  137.     
  138.     call    StopTimer
  139.     
  140.     mov     eax,[TimerE]
  141.     sub     eax,[TimerS]
  142.     imul    eax,10
  143.     mov     [Time3],eax
  144.  
  145.     mov     ax,3
  146.     int     10h
  147.  
  148.     mov     dx,offset Msg_Title
  149.     mov     ah,9
  150.     int     21h
  151.  
  152.     mov     dx,offset Msg_2VGA
  153.     mov     ah,9
  154.     int     21h
  155.  
  156.     mov     eax,256*182
  157.     xor     edx,edx
  158.     mov     ecx,[Time1]
  159.     div     ecx
  160.     call    PrintDouble
  161.  
  162.     mov     dx,offset Msg_MEM2VGA
  163.     mov     ah,9
  164.     int     21h
  165.  
  166.     mov     eax,256*182
  167.     xor     edx,edx
  168.     mov     ecx,[Time2]
  169.     div     ecx
  170.     call    PrintDouble
  171.  
  172.     mov     dx,offset Msg_VGA2VGA
  173.     mov     ah,9
  174.     int     21h
  175.  
  176.     mov     eax,256*182
  177.     xor     edx,edx
  178.     mov     ecx,[Time3]
  179.     div     ecx
  180.     call    PrintDouble
  181.  
  182.     mov     ax,4c00h
  183.     int     21h
  184. END START
  185.